﻿package PinballCode.Screens {
	
	import flash.display.MovieClip;
	import PinballCode.MainApp;
	import flash.events.MouseEvent;
	
	// InstructionScreen Class
	public class InstructionsScreen extends Screen {
		
		// Constructor
		public function InstructionsScreen(m:MainApp) {
			// constructor code
			super(m);
			
			init();
		}
		
		// initialize the game
		public function init()
		{
			//////////////////////////////////TO BE CHANGED
			//hard coded values for the location of the screen
			this.x = 340;
			this.y = 250;
		}
		
		// brings in the Screen
		public override function bringIn()
		{
			// the next line calls the superclass' bringIn();
			super.bringIn();
			
			//////////////////////////////////TO BE CHANGED
			//hard coded values for the location of the screen
			
			// set up the buttons			
			
			BackButton_mc.addEventListener(MouseEvent.CLICK, backToMenu);
		}
		
		// Bringsin Menu and removes this screen
		public function backToMenu(e:MouseEvent)
		{
			BackButton_mc.removeEventListener(MouseEvent.CLICK, backToMenu);
			app.displayScreen(MainMenu);
		}
	}
	
}
